
/**
 * Get a URL parameter from a GET request
 * 
 * @param name - The parameter name
 * @return value - the value of the parameter
 */
function gup(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}



/**
 * center any element on screen
 */
jQuery.fn.centerScreen = function(loaded) { 
    var obj = this; 
    if(!loaded) { 
  	  	  obj.css('position','absolute');
            obj.css('top', $(window).height()/2 - this.height()/2); 
            obj.css('left', $(window).width()/2 - this.width()/2); 
            $(window).resize(function() 
          		  { obj.centerScreen(!loaded); }); 
    			} else { 
            obj.stop(); 
            obj.animate({ top: $(window).height()/2- 
this.height()/2, left: $ 
(window).width()/2-this.width()/2}, 200, 'linear'); 
    } 
};
